<%@ Page Title="Information Management System" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="ConditionControl.aspx.cs" Inherits="CARMS.Admin.ConditionList" %>

<%@ Register Src="~/Controls/GridPager.ascx" TagName="GridPager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script>
        function OpenCreateCondition() {
            $dialog('<%=ResolveUrl("~/Admin/ConditionDetail.aspx") %>', { width: 750, height: 620 }, function(result) {
                if (result == true) {
                    $get('<%=btnRefresh.ClientID %>').click();
                }
            });
        } 
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <div class="divSeperatorH10"></div>
    <asp:Button runat="server" OnClientClick="OpenCreateCondition();return false;" Text="Create Condition"
        SkinID="Button180" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <div style="display:none">
          <asp:Button runat="server" SkinID="Hidden" OnClick="btnRefresh_Click" ID="btnRefresh" />
        </div>
        
            <fieldset>
                <legend>Columns List</legend>
                <vs:GridView ID="gridList" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                    OnRowDataBound="gridList_RowDataBound" OnRowCommand="gridList_OnRowCommand">
                    <Columns>
                        <vs:TemplateField HeaderText="Action ID" ItemStyle-Width="100px" SortExpression="ActionID">
                            <ItemTemplate>
                                <%#Eval("ActionID") %>
                            </ItemTemplate>
                        </vs:TemplateField>
                        <vs:TemplateField HeaderText="Table Name" ItemStyle-Width="100px" SortExpression="TableName">
                            <ItemTemplate>
                                <%#Eval("TableName")%>
                            </ItemTemplate>
                        </vs:TemplateField>
                        <vs:TemplateField HeaderText="Column Name" ItemStyle-Width="100px" SortExpression="ColumnName">
                            <ItemTemplate>
                                <%#Eval("ColumnName") %>
                            </ItemTemplate>
                        </vs:TemplateField>
                    </Columns>
                </vs:GridView>
                <uc1:GridPager ID="PageQueryAdapter1" runat="server" OnPerformGetCondition="PageQueryAdapter1_PerformGetCondition"
                    OnPerformGetRecordCount="PageQueryAdapter1_PerformGetRecordCount" OnPerformGetPageData="PageQueryAdapter1_PerformGetPageData"
                    TargetControlID="gridList" PageSize="100" />
            </fieldset>
        </ContentTemplate>
    </asp:UpdatePanel>
  
</asp:Content>
